import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home/index.vue'
import homePage from '../views/Home/homePage'
import lookHouse from '../views/Home/lookHouse'
import Publish from '../views/Home/Publish'
import Message from '../views/Home/Message'
import My from '../views/Home/My'

import buyHome from '../views/buyHome'
import Renting from '../views/Renting'
import Wanted from '../views/Wanted'
import Purchase from '../views/Purchase'
import findHome from '../views/findHome'
import Information from '../views/Information'
import homeMarket from '../views/homeMarket'
import Broker from '../views/Broker'
import Group from '../views/Group'
import Live from '../views/Live'
import resoldHome from '../views/resoldHome'
import Area from '../views/Area'
import Price from '../views/Price'
import houseType from '../views/houseType'
import Screen from '../views/Screen'
import resoldDetail from '../views/resoldDetail'
import City from '../views/City'

import Login from '../views/Login'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    redirect: '/homePage',
    children: [
      {
        path: '/homePage',
        name: 'homePage',
        component: homePage
      },
      {
        path: '/lookHouse',
        name: 'lookHouse',
        component: lookHouse
      },
      {
        path: '/publish',
        name: 'Publish',
        component: Publish
      },
      {
        path: '/message',
        name: 'Message',
        component: Message
      },
      {
        path: '/my',
        name: 'My',
        component: My
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/buyHome',
    name: 'buyHome',
    component: buyHome
  },
  {
    path: '/renting',
    name: 'Renting',
    component: Renting
  },
  {
    path: '/wanted',
    name: 'Wanted',
    component: Wanted
  },
  {
    path: '/purchase',
    name: 'Purchase',
    component: Purchase
  },
  {
    path: '/findHome',
    name: 'findHome',
    component: findHome
  },
  {
    path: '/information',
    name: 'Information',
    component: Information
  },
  {
    path: '/homeMarket',
    name: 'homeMarket',
    component: homeMarket
  },
  {
    path: '/broker',
    name: 'Broker',
    component: Broker
  },
  {
    path: '/group',
    name: 'Group',
    component: Group
  },
  {
    path: '/live',
    name: 'Live',
    component: Live
  },
  {
    path: '/resoldHome',
    name: 'resoldHome',
    component: resoldHome
  },
  {
    path: '/area',
    name: 'Area',
    component: Area
  },
  {
    path: '/price',
    name: 'Price',
    component: Price
  },
  {
    path: '/houseType',
    name: 'houseType',
    component: houseType
  },
  {
    path: '/screen',
    name: 'Screen',
    component: Screen
  },
  {
    path: '/resoldDetail/:id',
    name: 'resoldDetail',
    component: resoldDetail
  },
  {
    path: '/city',
    name: 'City',
    component: City
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
